package com.jilefojing.beans.pojos.enhanced;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Date;

import com.jilefojing.beans.enums.ItemTypeEnumForSource;
import com.jilefojing.beans.enums.ProgressStatusForSource;
import com.jilefojing.beans.enums.StatusEnumForPublish;
import com.jilefojing.beans.pojos.RCategorySource;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月26日 16时40分29秒
 */
public class EnhancedRCategorySource extends BaseEnhanced {
	public EnhancedRCategorySource(RCategorySource rCategorySource) {
		// TODO 自动生成 细微误差自己调整
		if (rCategorySource.getId() != null) {
			this.id = rCategorySource.getId();
		}
		if (rCategorySource.getItemType() != null) {
			this.itemType = ItemTypeEnumForSource
					.getItemTypeEnumByCode(rCategorySource.getItemType());
		}
		if (rCategorySource.getItemId() != null && this.itemType != null) {
			try {
				Class<? extends BaseEnhanced> _EnhancedClass = this.itemType
						.getEnhancedItemClass();
				BaseEnhanced _EnhancedItem = _EnhancedClass.newInstance();
				for (Method _Method : _EnhancedClass.getDeclaredMethods()) {
					if (_Method.getName().equals("setId")) {
						_Method.invoke(_EnhancedItem,
								rCategorySource.getItemId());
						break;
					}
				}
				this.enhancedItem = _EnhancedItem;
			} catch (SecurityException e) {
				e.printStackTrace();
			} catch (IllegalArgumentException e) {
				e.printStackTrace();
			} catch (InvocationTargetException e) {
				e.printStackTrace();
			} catch (InstantiationException e) {
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			}
		}

		if (rCategorySource.getCategoryC1() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC1());
			this.enhancedC1Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC2() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC2());
			this.enhancedC2Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC3() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC3());
			this.enhancedC3Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC4() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC4());
			this.enhancedC4Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC5() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC5());
			this.enhancedC5Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC6() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC6());
			this.enhancedC6Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC7() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC7());
			this.enhancedC7Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC8() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC8());
			this.enhancedC8Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC9() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC9());
			this.enhancedC9Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC10() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC10());
			this.enhancedC10Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC11() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC11());
			this.enhancedC11Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC12() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC12());
			this.enhancedC12Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC13() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC13());
			this.enhancedC13Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC14() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC14());
			this.enhancedC14Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC15() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC15());
			this.enhancedC15Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC16() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC16());
			this.enhancedC16Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC17() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC17());
			this.enhancedC17Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC18() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC18());
			this.enhancedC18Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC19() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC19());
			this.enhancedC19Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC20() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC20());
			this.enhancedC20Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC21() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC21());
			this.enhancedC21Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC22() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC22());
			this.enhancedC22Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC23() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC23());
			this.enhancedC23Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC24() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC24());
			this.enhancedC24Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC25() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC25());
			this.enhancedC25Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC26() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC26());
			this.enhancedC26Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC27() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC27());
			this.enhancedC27Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC28() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC28());
			this.enhancedC28Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC29() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC29());
			this.enhancedC29Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC30() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC30());
			this.enhancedC30Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC31() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC31());
			this.enhancedC31Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC32() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC32());
			this.enhancedC32Category = enhancedDCategory;
		}
		if (rCategorySource.getCategoryC33() != null) {
			EnhancedDCategory enhancedDCategory = new EnhancedDCategory();
			enhancedDCategory.setId(rCategorySource.getCategoryC33());
			this.enhancedC33Category = enhancedDCategory;
		}
		// TODO 可以继续增加 资源类别 搜索 “可以继续增加 资源类别” 这个地方需要增加

		if (rCategorySource.getCreateUser() != null) {
			EnhancedUser enhancedUser = new EnhancedUser();
			enhancedUser.setId(rCategorySource.getCreateUser());
			this.enhancedUser = enhancedUser;
		}

		this.createTime = rCategorySource.getCreateTime();
		this.updateTime = rCategorySource.getUpdateTime();

		if (rCategorySource.getStatus() != null) {
			this.status = StatusEnumForPublish
					.getStatusEnumByCode(rCategorySource.getStatus());
		}
		if (rCategorySource.getSort() != null) {
			this.sort = rCategorySource.getSort();
		}
		if (rCategorySource.getHotSort() != null) {
			this.hotSort = rCategorySource.getHotSort();
		}
		if (rCategorySource.getProgressStatus() != null) {
			this.progressStatus = ProgressStatusForSource
					.getProgressStatusEnumByCode(rCategorySource
							.getProgressStatus());
		}
	}

	public EnhancedRCategorySource() {
	}

	private long id;
	private ItemTypeEnumForSource itemType;
	private BaseEnhanced enhancedItem;
	private EnhancedUser enhancedUser;
	private Date createTime;
	private Date updateTime;

	private EnhancedDCategory enhancedC1Category;
	private EnhancedDCategory enhancedC2Category;
	private EnhancedDCategory enhancedC3Category;
	private EnhancedDCategory enhancedC4Category;
	private EnhancedDCategory enhancedC5Category;
	private EnhancedDCategory enhancedC6Category;
	private EnhancedDCategory enhancedC7Category;
	private EnhancedDCategory enhancedC8Category;
	private EnhancedDCategory enhancedC9Category;
	private EnhancedDCategory enhancedC10Category;
	private EnhancedDCategory enhancedC11Category;
	private EnhancedDCategory enhancedC12Category;
	private EnhancedDCategory enhancedC13Category;
	private EnhancedDCategory enhancedC14Category;
	private EnhancedDCategory enhancedC15Category;
	private EnhancedDCategory enhancedC16Category;
	private EnhancedDCategory enhancedC17Category;
	private EnhancedDCategory enhancedC18Category;
	private EnhancedDCategory enhancedC19Category;
	private EnhancedDCategory enhancedC20Category;
	private EnhancedDCategory enhancedC21Category;
	private EnhancedDCategory enhancedC22Category;
	private EnhancedDCategory enhancedC23Category;
	private EnhancedDCategory enhancedC24Category;
	private EnhancedDCategory enhancedC25Category;
	private EnhancedDCategory enhancedC26Category;
	private EnhancedDCategory enhancedC27Category;
	private EnhancedDCategory enhancedC28Category;
	private EnhancedDCategory enhancedC29Category;
	private EnhancedDCategory enhancedC30Category;
	private EnhancedDCategory enhancedC31Category;
	private EnhancedDCategory enhancedC32Category;
	private EnhancedDCategory enhancedC33Category;

	private StatusEnumForPublish status;
	private ProgressStatusForSource progressStatus;
	private double sort;
	private double hotSort;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public ItemTypeEnumForSource getItemType() {
		return itemType;
	}

	public void setItemType(ItemTypeEnumForSource itemType) {
		this.itemType = itemType;
	}

	public BaseEnhanced getEnhancedItem() {
		return enhancedItem;
	}

	public void setEnhancedItem(BaseEnhanced enhancedItem) {
		this.enhancedItem = enhancedItem;
	}

	public EnhancedUser getEnhancedUser() {
		return enhancedUser;
	}

	public void setEnhancedUser(EnhancedUser enhancedUser) {
		this.enhancedUser = enhancedUser;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public EnhancedDCategory getEnhancedC1Category() {
		return enhancedC1Category;
	}

	public void setEnhancedC1Category(EnhancedDCategory enhancedC1Category) {
		this.enhancedC1Category = enhancedC1Category;
	}

	public EnhancedDCategory getEnhancedC2Category() {
		return enhancedC2Category;
	}

	public void setEnhancedC2Category(EnhancedDCategory enhancedC2Category) {
		this.enhancedC2Category = enhancedC2Category;
	}

	public EnhancedDCategory getEnhancedC3Category() {
		return enhancedC3Category;
	}

	public void setEnhancedC3Category(EnhancedDCategory enhancedC3Category) {
		this.enhancedC3Category = enhancedC3Category;
	}

	public EnhancedDCategory getEnhancedC4Category() {
		return enhancedC4Category;
	}

	public void setEnhancedC4Category(EnhancedDCategory enhancedC4Category) {
		this.enhancedC4Category = enhancedC4Category;
	}

	public EnhancedDCategory getEnhancedC5Category() {
		return enhancedC5Category;
	}

	public void setEnhancedC5Category(EnhancedDCategory enhancedC5Category) {
		this.enhancedC5Category = enhancedC5Category;
	}

	public EnhancedDCategory getEnhancedC6Category() {
		return enhancedC6Category;
	}

	public void setEnhancedC6Category(EnhancedDCategory enhancedC6Category) {
		this.enhancedC6Category = enhancedC6Category;
	}

	public EnhancedDCategory getEnhancedC7Category() {
		return enhancedC7Category;
	}

	public void setEnhancedC7Category(EnhancedDCategory enhancedC7Category) {
		this.enhancedC7Category = enhancedC7Category;
	}

	public EnhancedDCategory getEnhancedC8Category() {
		return enhancedC8Category;
	}

	public void setEnhancedC8Category(EnhancedDCategory enhancedC8Category) {
		this.enhancedC8Category = enhancedC8Category;
	}

	public EnhancedDCategory getEnhancedC9Category() {
		return enhancedC9Category;
	}

	public void setEnhancedC9Category(EnhancedDCategory enhancedC9Category) {
		this.enhancedC9Category = enhancedC9Category;
	}

	public EnhancedDCategory getEnhancedC10Category() {
		return enhancedC10Category;
	}

	public void setEnhancedC10Category(EnhancedDCategory enhancedC10Category) {
		this.enhancedC10Category = enhancedC10Category;
	}

	public EnhancedDCategory getEnhancedC11Category() {
		return enhancedC11Category;
	}

	public void setEnhancedC11Category(EnhancedDCategory enhancedC11Category) {
		this.enhancedC11Category = enhancedC11Category;
	}

	public EnhancedDCategory getEnhancedC12Category() {
		return enhancedC12Category;
	}

	public void setEnhancedC12Category(EnhancedDCategory enhancedC12Category) {
		this.enhancedC12Category = enhancedC12Category;
	}

	public EnhancedDCategory getEnhancedC13Category() {
		return enhancedC13Category;
	}

	public void setEnhancedC13Category(EnhancedDCategory enhancedC13Category) {
		this.enhancedC13Category = enhancedC13Category;
	}

	public EnhancedDCategory getEnhancedC14Category() {
		return enhancedC14Category;
	}

	public void setEnhancedC14Category(EnhancedDCategory enhancedC14Category) {
		this.enhancedC14Category = enhancedC14Category;
	}

	public EnhancedDCategory getEnhancedC15Category() {
		return enhancedC15Category;
	}

	public void setEnhancedC15Category(EnhancedDCategory enhancedC15Category) {
		this.enhancedC15Category = enhancedC15Category;
	}

	public EnhancedDCategory getEnhancedC16Category() {
		return enhancedC16Category;
	}

	public void setEnhancedC16Category(EnhancedDCategory enhancedC16Category) {
		this.enhancedC16Category = enhancedC16Category;
	}

	public EnhancedDCategory getEnhancedC17Category() {
		return enhancedC17Category;
	}

	public void setEnhancedC17Category(EnhancedDCategory enhancedC17Category) {
		this.enhancedC17Category = enhancedC17Category;
	}

	public EnhancedDCategory getEnhancedC18Category() {
		return enhancedC18Category;
	}

	public void setEnhancedC18Category(EnhancedDCategory enhancedC18Category) {
		this.enhancedC18Category = enhancedC18Category;
	}

	public EnhancedDCategory getEnhancedC19Category() {
		return enhancedC19Category;
	}

	public void setEnhancedC19Category(EnhancedDCategory enhancedC19Category) {
		this.enhancedC19Category = enhancedC19Category;
	}

	public EnhancedDCategory getEnhancedC20Category() {
		return enhancedC20Category;
	}

	public void setEnhancedC20Category(EnhancedDCategory enhancedC20Category) {
		this.enhancedC20Category = enhancedC20Category;
	}

	public EnhancedDCategory getEnhancedC21Category() {
		return enhancedC21Category;
	}

	public void setEnhancedC21Category(EnhancedDCategory enhancedC21Category) {
		this.enhancedC21Category = enhancedC21Category;
	}

	public EnhancedDCategory getEnhancedC22Category() {
		return enhancedC22Category;
	}

	public void setEnhancedC22Category(EnhancedDCategory enhancedC22Category) {
		this.enhancedC22Category = enhancedC22Category;
	}

	public EnhancedDCategory getEnhancedC23Category() {
		return enhancedC23Category;
	}

	public void setEnhancedC23Category(EnhancedDCategory enhancedC23Category) {
		this.enhancedC23Category = enhancedC23Category;
	}

	public EnhancedDCategory getEnhancedC24Category() {
		return enhancedC24Category;
	}

	public void setEnhancedC24Category(EnhancedDCategory enhancedC24Category) {
		this.enhancedC24Category = enhancedC24Category;
	}

	public EnhancedDCategory getEnhancedC25Category() {
		return enhancedC25Category;
	}

	public void setEnhancedC25Category(EnhancedDCategory enhancedC25Category) {
		this.enhancedC25Category = enhancedC25Category;
	}

	public EnhancedDCategory getEnhancedC26Category() {
		return enhancedC26Category;
	}

	public void setEnhancedC26Category(EnhancedDCategory enhancedC26Category) {
		this.enhancedC26Category = enhancedC26Category;
	}

	public EnhancedDCategory getEnhancedC27Category() {
		return enhancedC27Category;
	}

	public void setEnhancedC27Category(EnhancedDCategory enhancedC27Category) {
		this.enhancedC27Category = enhancedC27Category;
	}

	public EnhancedDCategory getEnhancedC28Category() {
		return enhancedC28Category;
	}

	public void setEnhancedC28Category(EnhancedDCategory enhancedC28Category) {
		this.enhancedC28Category = enhancedC28Category;
	}

	public EnhancedDCategory getEnhancedC29Category() {
		return enhancedC29Category;
	}

	public void setEnhancedC29Category(EnhancedDCategory enhancedC29Category) {
		this.enhancedC29Category = enhancedC29Category;
	}

	public EnhancedDCategory getEnhancedC30Category() {
		return enhancedC30Category;
	}

	public void setEnhancedC30Category(EnhancedDCategory enhancedC30Category) {
		this.enhancedC30Category = enhancedC30Category;
	}

	public EnhancedDCategory getEnhancedC31Category() {
		return enhancedC31Category;
	}

	public void setEnhancedC31Category(EnhancedDCategory enhancedC31Category) {
		this.enhancedC31Category = enhancedC31Category;
	}

	public EnhancedDCategory getEnhancedC32Category() {
		return enhancedC32Category;
	}

	public void setEnhancedC32Category(EnhancedDCategory enhancedC32Category) {
		this.enhancedC32Category = enhancedC32Category;
	}

	public EnhancedDCategory getEnhancedC33Category() {
		return enhancedC33Category;
	}

	public void setEnhancedC33Category(EnhancedDCategory enhancedC33Category) {
		this.enhancedC33Category = enhancedC33Category;
	}

	public StatusEnumForPublish getStatus() {
		return status;
	}

	public void setStatus(StatusEnumForPublish status) {
		this.status = status;
	}

	public ProgressStatusForSource getProgressStatus() {
		return progressStatus;
	}

	public void setProgressStatus(ProgressStatusForSource progressStatus) {
		this.progressStatus = progressStatus;
	}

	public double getSort() {
		return sort;
	}

	public void setSort(double sort) {
		this.sort = sort;
	}

	public double getHotSort() {
		return hotSort;
	}

	public void setHotSort(double hotSort) {
		this.hotSort = hotSort;
	}

}